package com.test.myspringproject;

import com.test.myredis.RedisClient;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class MySpringProjectApplication {

    @Resource
    RedisClient redisClient;
    @Autowired
    UserTest user;

    public static void main(String[] args) {

        SpringApplication.run(MySpringProjectApplication.class, args);
    }

    @PostConstruct
    public void init() {
        redisClient.connect();
        System.out.println("redisClient.getHost() = " + redisClient.getHost());
        System.out.println("redisClient.getPort() = " + redisClient.getPort());
        System.out.println("redisClient.getPassword() = " + redisClient.getPassword());
        System.out.println("user.getName() = " + user.getName());

    }

}
